package com.morse;

public class MorseFormatterProxy implements com.morse.MorseFormatter {
  private String _endpoint = null;
  private com.morse.MorseFormatter morseFormatter = null;
  
  public MorseFormatterProxy() {
    _initMorseFormatterProxy();
  }
  
  public MorseFormatterProxy(String endpoint) {
    _endpoint = endpoint;
    _initMorseFormatterProxy();
  }
  
  private void _initMorseFormatterProxy() {
    try {
      morseFormatter = (new com.morse.MorseFormatterServiceLocator()).getMorseFormatter();
      if (morseFormatter != null) {
        if (_endpoint != null)
          ((javax.xml.rpc.Stub)morseFormatter)._setProperty("javax.xml.rpc.service.endpoint.address", _endpoint);
        else
          _endpoint = (String)((javax.xml.rpc.Stub)morseFormatter)._getProperty("javax.xml.rpc.service.endpoint.address");
      }
      
    }
    catch (javax.xml.rpc.ServiceException serviceException) {}
  }
  
  public String getEndpoint() {
    return _endpoint;
  }
  
  public void setEndpoint(String endpoint) {
    _endpoint = endpoint;
    if (morseFormatter != null)
      ((javax.xml.rpc.Stub)morseFormatter)._setProperty("javax.xml.rpc.service.endpoint.address", _endpoint);
    
  }
  
  public com.morse.MorseFormatter getMorseFormatter() {
    if (morseFormatter == null)
      _initMorseFormatterProxy();
    return morseFormatter;
  }
  
  public java.lang.String decode(java.lang.String text, java.lang.String seperator) throws java.rmi.RemoteException{
    if (morseFormatter == null)
      _initMorseFormatterProxy();
    return morseFormatter.decode(text, seperator);
  }
  
  public java.lang.String encode(java.lang.String text, java.lang.String seperator) throws java.rmi.RemoteException{
    if (morseFormatter == null)
      _initMorseFormatterProxy();
    return morseFormatter.encode(text, seperator);
  }
  
  
}